package com.example;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-07-14
 */
public class Demo03 {
  public static void main(String[] args) {
    //
    System.out.println(b(3));
  }
  static double b(int n){
      double j=0;
      for (double i = 1;i <= n;i++){
          j += 1 / i;
      }
      return j;
  }
}
